package com.train.service.impl;

import com.train.dto.CourseDTO;
import com.train.mapper.CourseMapper;
import com.train.pojo.Course;
import com.train.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseServiceImpl implements CourseService {
    @Autowired
    private CourseMapper courseMapper;

    @Override
    public List<CourseDTO> selectAllCourseDTO() {
        return courseMapper.selectAllCourseDTO();
    }

    @Override
    public List<CourseDTO> findByRequired(CourseDTO courseDTO) {
        return courseMapper.findByRequired(courseDTO);
    }

    @Override
    public List<Course> getCourseBydepid(Integer id) {
        return courseMapper.getCourseBydepid(id);
    }

    @Override
    public Course selectCourseById(int id) {
        return courseMapper.selectCourseById(id);
    }

    @Override
    public int addCourse(Course course) {
        return courseMapper.addCourse(course);
    }

    @Override
    public int updateCourse(Course course) {
        return courseMapper.updateCourse(course);
    }

    @Override
    public int deleteCourse(int id) {
        return courseMapper.deleteCourse(id);
    }
}
